package com.ad.pet.app.main.desniger.adapter;

import android.support.annotation.Nullable;
import android.widget.TextView;

import com.ad.pet.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by SEELE on 2019/6/26.
 */

public class DesnigerShopAdapter extends BaseQuickAdapter<String,BaseViewHolder>{

    public DesnigerShopAdapter( @Nullable List<String> data) {
        super(R.layout.item_desniger_shop_text_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {

        TextView tvName = helper.getView(R.id.tv_name);
        tvName.setText(item);
        if (helper.getLayoutPosition() % 2 == 0) {
            tvName.setBackgroundResource(R.drawable.shap_shop_fuji_main_line_color);
            tvName.setTextColor(mContext.getResources().getColor(R.color.shop_fujin_maincolor));
        } else {
            tvName.setBackgroundResource(R.drawable.shap_shop_fuji_fenhong_line_color);
            tvName.setTextColor(mContext.getResources().getColor(R.color.shop_fujin_fenhongcolor));
        }
    }
}
